﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MobileServer.Bll.Bis;
using Bingosoft.Data;

namespace MobileServer.Web
{
    public partial class RestApiList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsAdmin(Bingosoft.Security.SecurityContext.User.LoginId))
            {
                Response.Redirect("~/500.htm");
            }
        }

        private bool IsAdmin(string loginId)
        {
            var admin = Dao.Get().QueryEntity<UserInfo>("Security.GetAdminUsers", new { LoginId = loginId });
            return admin != null;
        }
    }
}